package com.city.lambda.cases;

import com.city.lambda.Student;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Cheng
 * Date: 2020/4/20
 * Time: 14:10
 * Description: No Description
 */
public class Cases {
    //集合排序
    //ArrayList<>()
    public static void main(String[] args) {
        List<Student> students = new ArrayList<>();
        students.add(new Student(20,"李金城"));
        students.add(new Student(21,"李福英"));
        students.add(new Student(22,"李汉洲"));
        students.add(new Student(23,"赖雪花"));
        students.add(new Student(24,"王蓝平"));
        //排序
        students.sort((o1, o2) -> o2.age-o1.age);
    }
}
